
#ifndef __BMANLIB__GAMESTATE_H__
#define __BMANLIB__GAMESTATE_H__

#include "../rsp/cmd.h"

///Game state object
struct GameState : rsp_base
{
    COMMAND_CLASS(GameState,"id:G")

    int state;                  ///< game state, see the enum below
    uint counter;               ///< game state timeout counter
    uchar winner;               ///< last game winner
    uchar players_ac;           ///< active players


    void state_save( frame_command_buffer& fcb ) const
    {   fcb.add_bin_from( (const uchar*)this, sizeof(*this) ); }

    void state_load( frame_command_reader& fcr )
    {   fcr.get(*this); }
};

#endif //__BMANLIB__GAMESTATE_H__
